<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>thunb</title>
</head>
<body>
	<button id="add"> hello world</button>
</body>
</html>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
	$(document).on('click','#add',function(){
		$.ajax({
			url:'server.php',
			type:'post',
			dataType:'json',
			data:{number:1314},
			success:function(req){
				if(req.code){
					alert('success')
				}
			}
		})

	})
})
</script>